// 在marked基础上 自定义部分格式

import { marked, Renderer } from "marked";

const reWriteRender = new marked.Renderer();

/**
 * 重写 heading  #-6#  h1-h6
 * @param this 
 * @param text 
 * @param level 
 * @param raw 
 * @param slugger 
 * @returns 
 */
reWriteRender.heading = (text, level, raw, slugger) => {
    let resStr: string;
    if (level === 1) {
        resStr = 1111;
    } else {
        resStr = `<h${level} class="custom-heading">${text}</h${level}>`;
    }
    return resStr;
}


export default reWriteRender